package cn.ctvonline.android.kaopu.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by dujian on 15/11/27.
 */
public class AmapSearchResult implements Parcelable {

    private int id;
    private String imageBigUrl;
    private String imageSmallUrl;
    private String intro;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getImageBigUrl() {
        return imageBigUrl;
    }

    public void setImageBigUrl(String imageBigUrl) {
        this.imageBigUrl = imageBigUrl;
    }

    public String getImageSmallUrl() {
        return imageSmallUrl;
    }

    public void setImageSmallUrl(String imageSmallUrl) {
        this.imageSmallUrl = imageSmallUrl;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public static final Parcelable.Creator<AmapSearchResult> CREATOR = new Creator() {
        @Override
        public AmapSearchResult createFromParcel(Parcel source) {
            // TODO Auto-generated method stub
            // 必须按成员变量声明的顺序读取数据，不然会出现获取数据出错
            AmapSearchResult sr = new AmapSearchResult();
            int id = source.readInt();
            String imageBigUrl = source.readString();
            String imageSmallUrl = source.readString();
            String intro = source.readString();
            sr.setId(id);
            sr.setImageBigUrl(imageBigUrl);
            sr.setImageSmallUrl(imageSmallUrl);
            sr.setIntro(intro);
            return sr;
        }

        @Override
        public AmapSearchResult[] newArray(int size) {
            // TODO Auto-generated method stub
            return new AmapSearchResult[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(imageBigUrl);
        dest.writeString(imageSmallUrl);
        dest.writeString(intro);
    }
}
